<template>
  <div class="establish">
    <div class="top">
      <div
        class="iconfont icon-cuocha_kuai"
        @click="$router.push('/home/recommend')"
      ></div>
      <div class="right">
        <div class="times">
          <div class="day">星期{{ dataTime }}</div>
          <div class="year">0{{ Month }}/{{ Year }}</div>
        </div>

        <div class="Date">{{ date }}</div>
      </div>
    </div>
    <img src="../../assets/5.png" alt="" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      Month: "",
      Year: "",
      date: "",
      dataTime: "",
    };
  },
  methods: {
    getTime() {
      this.Year = new Date().getFullYear();
      this.Month = new Date().getMonth() + 1;
      this.date = new Date().getDate();
      this.dataTime = new Date().getDay();

      console.log(this.Year);
      console.log(this.Month);
      console.log(this.date);
      if (this.dataTime == 1) {
        this.dataTime = "一";
      }
      if (this.dataTime == 2) {
        this.dataTime = "二";
      }
      if (this.dataTime == 3) {
        this.dataTime = "三";
      }
      if (this.dataTime == 4) {
        this.dataTime = "四";
      }
      if (this.dataTime == 5) {
        this.dataTime = "五";
      }
      if (this.dataTime == 6) {
        this.dataTime = "六";
      }
      console.log(this.dataTime);
    },
  },
  created() {
    this.getTime();
  },
};
</script>

<style lang='less'>
.establish {
  .top {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    padding-top: 40px;
    padding-bottom: 14px;
    background: #f7f7f7;
    .right {
      display: flex;
      align-items: center;
      .times {
        margin-right: 10px;
        .day {
          margin-bottom: 5px;
          float: right;
        }
      }
      .Date {
        font-size: 40px;
        font-weight: 500;
      }
    }
  }
}

img {
  width: 100%;
  height: 100%;
}
</style>